import { getItem, setItem } from './storage'
import { TIME_STAMP, TOKEN_TIMEOUT_VALUE } from '@/constant'
// 获取时间戳
export const getTimeStamp = () => {
  return getItem(TIME_STAMP)
}

// 设置时间戳
export const setTimeStamp = () => {
  setItem(TIME_STAMP, Date.now())
}

// 检验token是否超时
export const isCheckTimeout = () => {
  return Date.now() - getTimeStamp() > TOKEN_TIMEOUT_VALUE
}
